<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <title>修改商品种类</title>
    <script type="text/javascript">
        // $(function(){
        //     $("#ch").change(function(){
        //         $("#leve").val(
        //             $("#ch").val()
        //         )
        //     });
        // })
    </script>
</head>
<body>
<div style="width:98%;margin-left: 1%;">
    <div class="panel panel-default">
        <div class="panel-heading">
            修改商品种类
        </div>
        <div class="panel-body">
            <form action="${pageContext.request.contextPath }/adminGoods?method=updateGoodsType2" method="post">
                <div class="row">
                    <div class="form-group form-inline">
                        <span>所属种类</span>
                        <select name="goodsParent" id="ch">
                            <c:choose>
                                <c:when test="${not empty goodsType.parentName}">
                                    <option value="${goodsType.id }">${goodsType.parentName }</option>
                                </c:when>
                                <c:when test="${ empty goodsType.parentName}">
                                    <option value="${goodsType.id }">无</option>
                                </c:when>
                            </c:choose>
                            <option value="0">无所属种类</option>
                            <c:forEach items="${goodsTypeList }" var="type">
                                    <option value="${type.id }">${type.name }</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group form-inline">
                        <span>种类名称</span>
                        <input type="text" name="typename"  value="${goodsType.name}" class="form-control">
                    </div>
                </div>
                <div class="row">
                    <div class="form-group form-inline">
                        <input type="hidden" name="level"  value="${goodsType.level}" class="form-control">
                    </div>
                </div>
                <div class="row">
                    <div class="form-group form-inline">
                        <input type="hidden" name="id"  value="${goodsType.id}" class="form-control">
                    </div>
                </div>
<%--                <div class="row">--%>
<%--                    <div class="form-group form-inline">--%>
<%--                        <span>种类等级</span>--%>
<%--                        <input id="leve" type="text" name="typename"  value="${goodsType.level}" class="form-control">--%>
<%--                    </div>--%>
<%--                </div>--%>
                <div class="row">
                    <div class="btn-group">
                        <button type="reset" class="btn btn-default">清空</button>
                        <button type="submit" class="btn btn-default">修改</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
